/* eslint-disable comma-dangle */
import { RouteProps } from 'react-router';

type ValidComponent = React.ComponentType<any> | { default: React.ComponentType<any> };
// interface：接口只 声明成员方法不做实现
export interface ProjectRouteProps extends Omit<RouteProps, 'component'> {
  authority?: Array<string> | string // TODO: 权限控制，设置进入此页面的所需要权限，设置后将覆盖默认权限
  component: () => Promise<ValidComponent>
  icon?: string
  id: number
  name: string
  path: string
}

// 第一项默认选中
export const routes: Array<ProjectRouteProps> = [
  {
    component: () => import(
      /* webpackChunkName: "pages-dashboard-index" */
      '~/pages/dashboard/index'
    ),
    exact: true,
    id: 1,
    name: '工作台',
    path: '/',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-login" */
      '~/pages/login'
    ),
    exact: true,
    id: 2,
    name: '登录',
    path: '/login',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-project-list" */
      '~/pages/project/list'
    ),
    exact: true,
    id: 3,
    name: '项目汇总',
    path: '/project/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-project-my" */
      '~/pages/project/my'
    ),
    exact: true,
    id: 4,
    name: '我的项目',
    path: '/project/my',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-project-check" */
      '~/pages/project/check'
    ),
    exact: true,
    id: 5,
    name: '项目抽查',
    path: '/project/check',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-institution-list" */
      '~/pages/institution/list'
    ),
    exact: true,
    id: 6,
    name: '机构库',
    path: '/institution/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-institution-add" */
      '~/pages/institution/add'
    ),
    exact: true,
    id: 7,
    name: '新增机构',
    path: '/institution/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-institution-add" */
      '~/pages/institution/add'
    ),
    exact: true,
    id: 8,
    name: '编辑机构',
    path: '/institution/edit',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-institution-detail" */
      '~/pages/institution/detail'
    ),
    exact: true,
    id: 9,
    name: '机构详情',
    path: '/institution/detail',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-project-details" */
      '~/pages/project/details'
    ),
    exact: true,
    id: 10,
    name: '项目详情',
    path: '/project/details',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-project-new" */
      '~/pages/project/new'
    ),
    exact: true,
    id: 11,
    name: '项目新增',
    path: '/project/new',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-project-new" */
      '~/pages/project/new'
    ),
    exact: true,
    id: 12,
    name: '项目编辑',
    path: '/project/edit',
  },

  {
    component: () => import(
      /* webpackChunkName: "pages-case-list" */
      '~/pages/case/list'
    ),
    exact: true,
    id: 13,
    name: '案例列表',
    path: '/case/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-case-my" */
      '~/pages/case/my'
    ),
    exact: true,
    id: 14,
    name: '我的案例',
    path: '/case/my',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-case-add" */
      '~/pages/case/add'
    ),
    exact: true,
    id: 15,
    name: '案例新增',
    path: '/case/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-list" */
      '~/pages/policy/list'
    ),
    exact: true,
    id: 16,
    name: '政策库',
    path: '/policy/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-detail" */
      '~/pages/policy/detail'
    ),
    exact: true,
    id: 17,
    name: '政策详情',
    path: '/policy/detail',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-my" */
      '~/pages/policy/my'
    ),
    exact: true,
    id: 18,
    name: '我的政策',
    path: '/policy/my',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-add" */
      '~/pages/policy/add'
    ),
    exact: true,
    id: 19,
    name: '新增政策',
    path: '/policy/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-add" */
      '~/pages/policy/add'
    ),
    exact: true,
    id: 20,
    name: '编辑政策',
    path: '/policy/edit',
  },

  {
    component: () => import(
      '~/pages/news/list'
    ),
    exact: true,
    id: 21,
    name: '新闻列表',
    path: '/news/list',
  },
  {
    component: () => import(
      '~/pages/news/my'
    ),
    exact: true,
    id: 22,
    name: '我的新闻',
    path: '/news/my',
  },
  {
    component: () => import(
      '~/pages/news/audit'
    ),
    exact: true,
    id: 23,
    name: '新闻审核',
    path: '/news/audit',
  },
  {
    component: () => import(
      '~/pages/news/add'
    ),
    exact: true,
    id: 24,
    name: '新增新闻',
    path: '/news/add',
  },
  {
    component: () => import(
      '~/pages/news/add'
    ),
    exact: true,
    id: 25,
    name: '新闻编辑',
    path: '/news/edit',
  },
  {
    component: () => import(
      '~/pages/news/details'
    ),
    exact: true,
    id: 26,
    name: '新闻详情',
    path: '/news/details',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-case-add" */
      '~/pages/case/add'
    ),
    exact: true,
    id: 27,
    name: '案例修改',
    path: '/case/edit',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-case-add" */
      '~/pages/case/detail'
    ),
    exact: true,
    id: 28,
    name: '案例详情',
    path: '/case/detail',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-experience-list" */
      '~/pages/experience/list'
    ),
    exact: true,
    id: 29,
    name: '国际经验',
    path: '/experience/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-experience-add" */
      '~/pages/experience/add'
    ),
    exact: true,
    id: 30,
    name: '国际经验新增',
    path: '/experience/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-experience-my" */
      '~/pages/experience/my'
    ),
    exact: true,
    id: 31,
    name: '我的国际经验',
    path: '/experience/my',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-experience-add" */
      '~/pages/experience/add'
    ),
    exact: true,
    id: 32,
    name: '国际经验修改',
    path: '/experience/edit',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-case-add" */
      '~/pages/experience/detail'
    ),
    exact: true,
    id: 33,
    name: '国际经验详情',
    path: '/experience/detail',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-dashboard-profile" */
      '~/pages/dashboard/profile'
    ),
    exact: true,
    id: 34,
    name: '个人资料修改',
    path: '/dashboard/profile',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-dashboard-messages" */
      '~/pages/dashboard/messages'
    ),
    exact: true,
    id: 35,
    name: '站内信',
    path: '/dashboard/messages',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-dashboard-notification" */
      '~/pages/dashboard/notification'
    ),
    exact: true,
    id: 36,
    name: '系统通知',
    path: '/dashboard/notification',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-user-management" */
      '~/pages/user/management'
    ),
    exact: true,
    id: 37,
    name: '用户管理',
    path: '/user/management',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-user-add" */
      '~/pages/user/add'
    ),
    exact: true,
    id: 38,
    name: '新增用户',
    path: '/user/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-user-add" */
      '~/pages/user/add'
    ),
    exact: true,
    id: 39,
    name: '编辑用户',
    path: '/user/edit',
  },
  {
    component: () => import(
      // Role & Permission
      /* webpackChunkName: "pages-permission-list" */
      '~/pages/permission/list'
    ),
    exact: true,
    id: 40,
    name: '角色权限',
    path: '/permission/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-permission-add" */
      '~/pages/permission/add'
    ),
    exact: true,
    id: 41,
    name: '新增权限',
    path: '/permission/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-permission-edit" */
      '~/pages/permission/add'
    ),
    exact: true,
    id: 42,
    name: '编辑权限',
    path: '/permission/edit',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-list" */
      '~/pages/events/add'
    ),
    exact: true,
    id: 43,
    name: '编辑会议',
    path: '/events/edit',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-list" */
      '~/pages/events/add'
    ),
    exact: true,
    id: 44,
    name: '新增会议',
    path: '/events/add',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-policy-list" */
      '~/pages/events/list'
    ),
    exact: true,
    id: 45,
    name: '会议事件',
    path: '/events/list',
  },
  {
    component: () => import(
      /* webpackChunkName: "pages-experience-my" */
      '~/pages/events/my'
    ),
    exact: true,
    id: 46,
    name: '我的会议',
    path: '/events/my',
  },
  {
    component: () => import(
      '~/pages/events/details'
    ),
    exact: true,
    id: 47,
    name: '会议详情',
    path: '/events/details',
  },
  {
    component: () => import(
      '~/pages/more/list'
    ),
    exact: true,
    id: 48,
    name: '更多',
    path: '/login/more',
  },
  {
    component: () => import(
      '~/pages/more/details'
    ),
    exact: true,
    id: 49,
    name: '详情',
    path: '/login/more/details',
  },
  // {
  //   component: () => import(
  //     '~/pages/self/index'
  //   ),
  //   exact: true,
  //   id: 50,
  //   name: '小丽文',
  //   path: '/self',
  // },
  {
    component: () => import(
      /* webpackChunkName: "common-NotMatch" */
      '~/common/NotMatch'
    ), // 404 page
    exact: false,
    id: -1,
    name: '404',
    path: '*',
  },
];

export default routes;
